#!/bin/bash

ROOT_PATH=`cd $(dirname "$0")/../; pwd`

make -C ${ROOT_PATH}/kernel_imx -j1 uImage ARCH=arm CROSS_COMPILE=${ROOT_PATH}/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
install -D ${ROOT_PATH}/kernel_imx/arch/arm/boot/uImage  ${ROOT_PATH}/out/target/product/sabresd_6dq/uImage
install -D ${ROOT_PATH}/kernel_imx/arch/arm/boot/zImage  ${ROOT_PATH}/out/target/product/sabresd_6dq/kernel
${ROOT_PATH}/out/host/linux-x86/bin/acp -fp ${ROOT_PATH}/device/fsl/sabresd_6dq/fstab.freescale ${ROOT_PATH}/out/target/product/sabresd_6dq/root/fstab.freescale
${ROOT_PATH}/out/host/linux-x86/bin/mkbootfs ${ROOT_PATH}/out/target/product/sabresd_6dq/root | ${ROOT_PATH}/out/host/linux-x86/bin/minigzip > ${ROOT_PATH}/out/target/product/sabresd_6dq/ramdisk.img
${ROOT_PATH}/out/host/linux-x86/bin/mkbootimg  --kernel ${ROOT_PATH}/out/target/product/sabresd_6dq/kernel --ramdisk ${ROOT_PATH}/out/target/product/sabresd_6dq/ramdisk.img --cmdline "console=ttymxc0,115200 init=/init video=mxcfb0:dev=ldb,bpp=32 video=mxcfb1:off video=mxcfb2:off fbmem=10M fb0base=0x27b00000 vmalloc=400M androidboot.console=ttymxc0 androidboot.hardware=freescale" --base 0x10800000  --output ${ROOT_PATH}/out/target/product/sabresd_6dq/boot.img
ls -l ${ROOT_PATH}/out/target/product/sabresd_6dq/*.img


